<template>
  <div class="p-4 bg-[#28365a] h-[calc(100vh-87px)]">
    <div class="text-center text-[#fff]">
      <span class="mr-10">姓名：{{ info?.name }}</span>
      <span class="mr-10">年龄：{{ info?.age }}</span>
      <span class="mr-10">性别：{{ info?.sex == '1' ? '男' : '女' }}</span>
      <span class="mr-10">编号：{{ info?.no }}</span>
      <span>联系电话：{{ info?.mobile }}</span>
    </div>
    <div class="my-3">
      <el-radio-group v-model="tabPosition">
        <el-radio-button label="1">历史数据</el-radio-button>
        <el-radio-button label="2">预警事件</el-radio-button>
      </el-radio-group>
    </div>
    <HistoryDataVue v-if="tabPosition === '1'" :family-id="info.id" />
    <WarningEvents v-if="tabPosition === '2'" :family-id="info.id" />
  </div>
</template>

<script lang="ts" setup>
import { usePatientStore } from '@/stores/patient'
import { onMounted, ref } from 'vue'
import HistoryDataVue from './component/HistoryData.vue'
import WarningEvents from './component/WarningEvents.vue'
const info: any =
  usePatientStore().patientBPInfo || JSON.parse(sessionStorage.getItem('patientBPInfo') as string)
const tabPosition = ref('1')

onMounted(() => {
  console.log(usePatientStore().patientBPInfo)
})
</script>

<style scoped lang="less"></style>
